const files = import.meta.globEager('./**/*.js');
const modules = [];

Object.keys(files).forEach(key => {
    if (key === './index.js') return;
    const item = files[key].default;
    item.map(v => {
        const apiBaseUrl = v.mock ? '/mockapi' : import.meta.env.VITE_BASE_API_URL;
        v.url = apiBaseUrl + v.url;
        return v;
    });
    modules.push(...item);
});

export default modules;
